package com.zyl.pts.web.controller;

import com.zyl.pts.config.anno.SystemLog;
import com.zyl.pts.config.enums.CodeAndMessageEnum;
import com.zyl.pts.config.result.Result;
import com.zyl.pts.service.OtherService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version v1.0
 * @ProjectName: product_source
 * @Package: com.zyl.pts.web.controller
 * @ClassName: OtherController
 * @Description TODO(补充模块-下拉列表)
 * @Author 翟玉龙
 * @Date 2024/11/18-17:15
 */
@Tag(name = "补充模块-下拉列表", description = "补充模块-下拉列表")
@RestController
public class OtherController {

    private final OtherService otherService;

    public OtherController(OtherService otherService) {
        this.otherService = otherService;
    }

    /**
     * 查询所有批次信息下拉列表接口
     * @return {@link Result }<{@link ? }>
     */
    @SystemLog(business = "查询所有批次信息下拉列表接口")
    @Operation(summary = "查询所有批次信息下拉列表接口")
    @GetMapping("/batch/queryAll")
    public Result<?> batchQueryAll() {
        return Result.success(
                CodeAndMessageEnum.SUCCESS,
                otherService.queryBatchList()
        );
    }

    /**
     * 查询所有栏圈信息下拉列表接口
     * @return {@link Result }<{@link ? }>
     */
    @Operation(summary = "查询所有栏圈信息下拉列表接口")
    @GetMapping("/hurdles/selectAllHurdles")
    public Result<?> hurdlesQueryAll() {
        return Result.success(
                CodeAndMessageEnum.SUCCESS,
                otherService.queryHurdlesList()
        );
    }
}
